#ifndef _TERRAIN_H_
#define _TERRAIN_H_

#include <d3dx9.h>

struct CUSTOMVERTEX
{
	D3DXVECTOR3 Pos;
	float		u, v;
};

struct CUSTOMINDEX
{
	WORD _0, _1, _2;
};


class Terrain
{
public:

	Terrain();
	~Terrain();

	void Update();
	void Render();
	bool Create( IDirect3DDevice9  *pDevice,int Width, int Height );

	void Release();


private:

	
	int m_iWidth;
	int m_iHeight;
	
	int m_iVertexNum;
	int m_iFaceNum;

	bool InitVB();
	bool InitIB();

	DWORD m_FVF;

	IDirect3DDevice9			*m_pkDevice;
	IDirect3DVertexBuffer9		*m_pkMapVB;
	IDirect3DIndexBuffer9		*m_pkMapIB;
	IDirect3DTexture9			*m_pkTexture;

	D3DXMATRIXA16				m_matworld;


protected:

	
};

#endif

